package cn.appkf.flappybird.screen;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.utils.viewport.StretchViewport;
import com.test.TestGame;

import cn.appkf.flappybird.stage.LoginStage;

/**
 * Created by Administrator on 2016/8/8.
 */
public class LoginScreen extends ScreenAdapter {

    private TestGame mainGame;

    private LoginStage loginStage;

    public LoginScreen(TestGame mainGame) {
        this.mainGame=mainGame;

        loginStage=new LoginStage(mainGame, new StretchViewport(
                mainGame.getWorldWidth(),
                mainGame.getWorldHeight()
        ));

        Gdx.input.setInputProcessor(loginStage);
    }

    @Override
    public void render(float delta) {
        super.render(delta);

        if(loginStage.isVisible()){
            loginStage.act(delta);
            loginStage.draw();
        }

    }
}
